<?php
// $Id$

/**
 * Controller_Admin_Default controller
 */
class Controller_Admin_Default extends Controller_Admin_Abstract
{
	function actionIndex()
	{
    }

    function actionLogin()
    {
        $username = trim($this->_context->username);
        $password = trim($this->_context->password);

        $user = Member::meta()->validateLogin($username, $password);
        if ($user->id())
        {
            $roles = $user->aclRoles();
            if (in_array('ADMIN', $roles))
            {
                $this->_app->changeCurrentUser($user->aclData(), $roles);
                return $this->_redirect(url('dashboard'));
            }
        }

        return $this->_redirectMessage(
            '提示信息',
            '请输入有效的管理用户帐户信息登录',
            url('default/index')
        );
    }
}


